/*
Automatic clinic tests using a robot arm.
Copyright (C) 2010  CIC-CPC, CHU Gabriel Montpied
All other trademarks, logos and copyrights are the property
of their respective owners.

This file is part of cpc-painbot.

cpc-painbot is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

cpc-painbot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with cpc-painbot.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef REGULATEUR_H
#define REGULATEUR_H

#include <QObject>
#include <QVariant>

class Asservissement;

/*! Régulateur du système.
    Utilisé par l'Asservissement pour que le système atteigne la consigne donnée.
*/
class Regulateur : public QObject
{
Q_OBJECT
Q_PROPERTY(QVariant consigne READ consigne WRITE setConsigne)
public:
    //! Constructeur.
    explicit Regulateur(QObject *parent = 0);

    //! Fournit la consigne.
    QVariant consigne() const { return consigne_; }

public slots:
    /*! Régule le système. */
    virtual void reguler(const Asservissement *systeme) = 0;

    /*! Définit la consigne du système.
        \param[in] consigne La nouvelle consigne.
    */
    void setConsigne(const QVariant &consigne) { consigne_ = consigne; }

protected:
    QVariant consigne_; //!< Consigne de régulation.
};

#endif // REGULATEUR_H
